import javax.swing.*;
import java.awt.*;

//窗口类
public class JFrameDemo extends JPanel {
    @Override
    public void paint(Graphics g) {
        super.paint(g);//调用父类画画的方法----清除运动轨迹
//        g.drawString("score",30,50);
        //设置字体大小、字体颜色
        Font font = new Font("微软素黑",Font.BOLD,25);
        g.setFont(font);
        g.setColor(Color.BLUE);
        g.drawString("score",30,50);
    }





    public static void main(String[] args) {
        //创建窗口对象
        JFrame win = new JFrame();
        //设置窗口标题
        win.setTitle("飞机大战");
        //设置窗口大小
        win.setSize(400,650);
        //居中显示
        win.setLocationRelativeTo(null);
        //设置窗口没有外边框
        //win.setUndecorated(true);
        //显示窗口
        win.setVisible(true);
        //设置窗口默认关闭选项
        win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //将画板添加到窗口上
        JFrameDemo panel = new JFrameDemo();
        win.add(panel);


    }
}
